package com.qj.platform.pay.core.service;

import com.qj.base.commons.domain.SearchObject;
import com.qj.platform.pay.core.dao.MerchantDao;
import com.qj.platform.pay.mssm.domain.Merchant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by zhijie on 2016/12/14.
 */
@Service
public class MerchantService {
    @Autowired
    private MerchantDao merchantDao;

    public Merchant getById(String id){
        return merchantDao.getById(id);
    }
    public String insert(Merchant merchant){
        String id = merchantDao.insert(merchant);
//        Merchant merchantResponse=MSSMPayService.getMSSMPayPlatformInstance().addMerchant(merchant);
//        merchantDao.updateMerchantCode(id,merchantResponse.getMerchantCode());
        return id;
    }
    public void update(Merchant merchant){
        merchantDao.update(merchant);
//        MSSMPayService.getMSSMPayPlatformInstance().updateMerchant(merchant);
    }
    public List<Merchant> query(SearchObject searchObject){
        return merchantDao.search(searchObject);
    }
    public int queryCount(SearchObject searchObject){
        return merchantDao.searchCount(searchObject);
    }
}
